﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PokerClient.Connection.CommandHandlers;

namespace PokerClient.Commands.CommandFactories
{
	class showHandsHandler : absHandler
	{
		private VisualDisp.Table table;
		private Client myClient;
		String message = " ";
		public showHandsHandler(VisualDisp.Table table, Client myClient)
		{
			// TODO: Complete member initialization
			this.table = table;
			this.myClient = myClient;
		}

		public override void assignCommand(string commands)
		{
			this.commands = commands.Split(' ');
		}

		public override string work()
		{
			String[] temp;
			if (commands.Length > 1)
			{
				temp = commands[1].Split('|');
				message = table.showHands(temp);
			}
			else
				message = table.showHands(commands[1]);
			return message;
		}

		public override void analyze()
		{
			this.table.updateStatus(message);
		}
	}
}
